function coroutine_test(a)
{
	::print(a+" started...\n");
	local life = true;
	while(life){
		::print(a+" saying...\n");
		life = ::suspend("...");
		::sleep(100);
	}
	return "I'm done"
}
local c1 = ::newthread(coroutine_test);
c1.call(1)
local c2 = ::newthread(coroutine_test);
c2.call(2)
local i = 1;
do
{
	c1.wakeup(true);
	c2.wakeup(true);
	++i;
	sleep(100);
}while(i < 10)

c1.wakeup(false);
c2.wakeup(false);


function response_request(req){
	
}

class coroutine_manager{
	n = 10;
	pool = {};
	constructor(n){
		coroutine_manager::n = n;
		for(local i = 1;i <= coroutine_manager::n;++i){
			coroutine_manager::pool[i] = ::newthread(::response_request);
			
		}
	}
	
	
	
	function kill(){
		foreach(k,v in coroutine_manager::pool){
			v.wakeup(null);
		}
	}
}